\documentclass{article}
\begin{document}
\section{No fraction}
\[ a+2 b\]
\[ a+123.456 b\]
\section{Mixed}
\[ 1\frac{1}{2} \]
\[ a+123\frac{12}{34} b\]
\section{Not Mixed}
\[ a+123\frac{12.0}{34} b\]
\[ a+123\frac{12}{y} b\]
\[ a+123\frac{12x}{y} b\]
\[ a+123\frac{x}{y} b\]
\[ a+123.456\frac{12}{34} b\]
\[ a+2 b \frac{1}{3}\]
\[ 2\frac{(-1)^m}{(2m)!} \]
\end{document}
